<?php

/* @var $this \yii\web\View */
/* @var $content string */

use backend\assets\WenmingindexAsset;
use yii\helpers\Html;
use backend\components\Menu;
use yii\helpers\Url;
use common\models\Notice;

WenmingindexAsset::register($this);
$WenmingindexAssetUrl=$this->getAssetManager()->getBundle(WenmingindexAsset::className())->baseUrl;
$i=1;
$notice = Notice::getnotice();
?>
<?php $this->beginPage() ?>
<!DOCTYPE HTML>
<html>
<head>
<title>微信群管理系统</title>
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta name="keywords" content="" />
<script type="application/x-javascript"> addEventListener("load", function() { setTimeout(hideURLbar, 0); }, false); function hideURLbar(){ window.scrollTo(0,1); } </script>
<!-- basic styles -->
<?php $this->head() ?>
<style>
#chartdiv {
  width: 100%;
  height: 295px;
}
</style>
</head>

<body class="cbp-spmenu-push">
	<?php $this->beginBody() ?>
    <div class="main-content">
	<div class="cbp-spmenu cbp-spmenu-vertical cbp-spmenu-left" id="cbp-spmenu-s1">
		<!--left-fixed -navigation-->
		<aside class="sidebar-left">
      <nav class="navbar navbar-inverse">
          <div class="navbar-header">
            <button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target=".collapse" aria-expanded="false">
            <span class="sr-only">Toggle navigation</span>
            <span class="icon-bar"></span>
            <span class="icon-bar"></span>
            <span class="icon-bar"></span>
            </button>
            <h1><a class="navbar-brand" href="index.html"><span class="dashboard_text"></span></a></h1>
          </div>
          <div class="collapse navbar-collapse" id="bs-example-navbar-collapse-1">
            <?php
                if(isset(Yii::$app->session['adminuser']))
                {
                    $menus=Yii::$app->session['adminuser']->role->getMenusArray();
                    echo Menu::widget([
                        'options' => [
                            'class' => 'sidebar-menu',
                            'id' => 'side-menu'
                        ],
                        'items' =>  $menus,
                    ]);
                }
        
            
            ?>
            </ul>
          </div>
          <!-- /.navbar-collapse -->
      </nav>
    </aside>
	</div>
		<!--left-fixed -navigation-->
		
		<!-- header-starts -->
		<div class="sticky-header header-section ">
			<div class="header-left">
				<!--toggle button start-->
				<button id="showLeftPush"><i class="fa fa-bars"></i></button>
				<!--toggle button end-->
				<div class="profile_details_left"><!--notifications of menu start -->
					<ul class="nofitications-dropdown">
						<li class="dropdown head-dpdn">
							<a href="#" class="dropdown-toggle" data-toggle="dropdown" aria-expanded="false"><i class="fa fa-envelope"></i><span class="badge"><?=$notice['num']?></span></a>
							<ul class="dropdown-menu">
								<li>
									<div class="notification_header">
										<h3>你有<?=$notice['num']?>条新消息</h3>
									</div>
								</li>
								<?php foreach($notice['notice'] as $key=>$val){?>
								<li>
									<a href="<?=Url::toRoute(['/admin/notice/detail','msg_id'=>$val['msg_id']])?>">
										<div class="notification_desc">
											<p><?=$val['title']?></p>
											<p><span><?=date('Y-m-d H:i:s',$val['add_time'])?></span></p>
										</div>
										<div class="clearfix"></div>	
									</a>
								</li>
								<?php }?>
								<li>
									<div class="notification_bottom">
										<a href="<?=Url::toRoute(['/admin/notice/index']);?>">查看所有信息</a>
									</div> 
								</li>
							</ul>
						</li>
						
					</ul>
					<div class="clearfix"> </div>
				</div>
				<!--notification menu end -->
                <button id="showLeftPush" onclick='chat()' style="background-color:#4EEE94;margin-left:8px"><i class="fa fa-comments"></i></button>
                <button class="newicon" style="background-color:#B0E2FF;margin-left:16px"><a href="<?=Url::toRoute(['/admin/index/index'])?>"><i class="fa fa-home"></i></a></button>
				<div class="clearfix"> </div>
			</div>
			<div class="header-right">
				<div class="profile_details">		
					<ul>
						<li class="dropdown profile_details_drop">
							<a href="#" class="dropdown-toggle" data-toggle="dropdown" aria-expanded="false">
								<div class="profile_img">	
									<span class="prfil-img"><img src="<?=$WenmingindexAssetUrl;?>/images/2.jpg" alt=""> </span> 
									<div class="user-name">
										<p><?=$_SESSION['adminuser']['username']?></p>
										<span>管理员</span>
									</div>
									<i class="fa fa-angle-down lnr"></i>
									<i class="fa fa-angle-up lnr"></i>
									<div class="clearfix"></div>	
								</div>	
							</a>
							<ul class="dropdown-menu drp-mnu">
								<li> <a href="<?=Url::toRoute(['/admin/login/logout']);?>"><i class="fa fa-sign-out"></i> 注销</a> </li>
							</ul>
						</li>
					</ul>
				</div>
				<div class="clearfix"> </div>				
			</div>
			<div class="clearfix"> </div>	
		</div>
		<!-- //header-ends -->
		<!-- main content start-->
		<!-- main content start-->
		<div id="page-wrapper">
        <div class="main-page">
        <div class="col_3">
        <div class="col-md-3 widget widget1">
            <div class="r3_counter_box">
                <a href="<?=Url::toRoute(['/content/content/index']);?>"><i class="pull-left fa fa-laptop icon-rounded"></i></a>
                <div class="stats">
                  <h5><strong><?=$content_num?>条</strong></h5>
                  <span>内容发布量</span>
                </div>
            </div>
        </div>
        <div class="col-md-3 widget widget1">
            <div class="r3_counter_box">
                <a href="<?=Url::toRoute(['/admin/order/index','op'=>'alldispatch']);?>"><i class="pull-left fa fa-file user1 icon-rounded"></i></a>
                <div class="stats">
                  <h5><strong><?=$order_num?>条</strong></h5>
                  <span>工单管理量</span>
                </div>
            </div>
        </div>
        <div class="col-md-3 widget widget1">
            <div class="r3_counter_box">
            <a href="<?=Url::toRoute(['/admin/statistics/index']);?>"><i class="pull-left fa fa-pie-chart user2 icon-rounded"></i></a>
                <div class="stats">
                <h5><strong>2018-4-30</strong></h5>
                  <span>最新数据分析</span>
                </div>
            </div>
        </div>
        <div class="col-md-3 widget widget1">
            <div class="r3_counter_box">
                <a href="<?=Url::toRoute(['/admin/notice/index']);?>"><i class="pull-left fa fa-envelope dollar1 icon-rounded"></i></a>
                <div class="stats">
                  <h5><strong><?=$notice_num?>条</strong></h5>
                  <span>未查看消息</span>
                </div>
            </div>
         </div>
        <div class="col-md-3 widget">
            <div class="r3_counter_box">
                <a href="<?=Url::toRoute(['/admin/contact/index']);?>"><i class="pull-left fa fa-users dollar2 icon-rounded"></i></a>
                <div class="stats">
                  <h5><strong><?=$admin_num?>人</strong></h5>
                  <span>通讯录人员</span>
                </div>
            </div>
         </div>
        <div class="clearfix"> </div>
    </div>
    

        <div class="row-one widgettable">
        <div class="col-md-7">
            <div class="card">
            <div class="agileinfo-cdr">
            <!-- 为ECharts准备一个具备大小（宽高）的Dom -->
                <div id="main" style="width: 860px;height:650px;"></div>

                <script type="text/javascript">
                    // 基于准备好的dom，初始化echarts实例
                    var myChart = echarts.init(document.getElementById('main'));
                    
                    myChart.showLoading();

                    $.getJSON('/backend/web/js/jinan.json', function (geoJson) {
                        myChart.hideLoading();
                        
                        echarts.registerMap('jinan', geoJson);
                        
                        option = {
                            title: {
                                text: '工单处置量',
                                subtext: '济南各城区',
                                textStyle:{
                                    color:'#ccc',
                                }
                                
                            },
                            tooltip: {
                                trigger: 'item',
                                formatter: '{b}<br/>{c} 条'
                            },
                            toolbox: {
                                show: true,
                                orient: 'vertical',
                                left: 'right',
                                top: 'center',
                                feature: {
                                    dataView: {readOnly: false},
                                    restore: {},
                                    saveAsImage: {}
                                }
                            },
                            visualMap: {
                                min: 0,
                                max: 10,
                                text:['High','Low'],
                                //realtime: false,
                                calculable: true,
                                inRange: {
                                    color: ['lightskyblue','yellow','orangered']
                                }
                            },
                            series: [
                                {
                                    name: '济南',
                                    type: 'map',
                                    zoom: 1.25,
                                    mapType: 'jinan', // 自定义扩展图表类型
                                    itemStyle:{
                                        normal:{
                                            label:{show:true},
                                        },
                                        emphasis:{
                                            label:{show:true}
                                        }
                                    },
                                    data:<?=$echo?>,
                                }
                            ]
                        };
                        // 使用刚指定的配置项和数据显示图表。
                        myChart.setOption(option);
                    });
                </script>
            </div>
        </div>
        </div>
        <div class="col-md-5 p_no">
        <div class="col-md-7 stat p_no">
        <?php foreach($ast as $key=>$val){?>
           <div class="content-top-1">
               <div class="col-md-6 top-content">
                   <h5>满意度NO.<?=$i?><br><?=$key?></h5>
                   <label><?=$dnum[$key]?>+</label>
               </div>
               <div class="col-md-6 top-content1">	   
                   <div id="demo-pie-<?=4-$i?>" class="pie-title-center" data-percent="<?=$val?>"> <span class="pie-value"></div>
               </div>
                <div class="clearfix"> </div>
               </div>
        <?php $i++;}?>
           </div>
        <div class="col-md-5 stat">
            <div class="content-top">
                <div class="top-content facebook">
                    <a href="<?=Url::toRoute(['/admin/order/index','op'=>'nodispatch']);?>"><i class="fa fa-tasks"></i></a>
                </div>
                <ul class="info">
                    <li class="col-md-6"><b><?=$new_order;?></b><p>新工单</p></li>
                    <li class="col-md-6"><b><?=$old_order?></b><p>已结单</p></li>
                    <div class="clearfix"></div>
                </ul>
            </div>
            <div class="content-top">
                <div class="top-content twitter">
                    <a href="<?=Url::toRoute(['/admin/order/index','op'=>'nodisposal']);?>"><i class="fa fa-mail-reply-all"></i></a>
                </div>
                <ul class="info">
                    <li class="col-md-6"><b><?=$nodo_order?></b><p>未处置工单</p></li>
                    <li class="col-md-6"><b><?=$do_order?></b><p>已处置工单</p></li>
                    <div class="clearfix"></div>
                </ul>
            </div>
            <div class="content-top">
                <div class="top-content google-plus">
                    <a href="<?=Url::toRoute(['/admin/order/index','op'=>'nofeedback']);?>"><i class="fa fa-pencil"></i></a>
                </div>
                <ul class="info">
                    <li class="col-md-6"><b><?=$nore_order?></b><p>未反馈工单</p></li>
                    <li class="col-md-6"><b><?=$re_order?></b><p>已反馈工单</p></li>
                    <div class="clearfix"></div>
                </ul>
            </div>   
        </div> 
        </div>
        <div class="col-md-5 p_no">
            <div class=" charts-grids widget2">
                    <div class="card-header">
                        <h3>区县数据汇总</h3>
                    </div>
                <div id="area" style="width:600px;height:203px;"></div>
        </div>
       
        <div class="clearfix"> </div>
        
    </div>
            <script type="text/javascript">
                // 基于准备好的dom，初始化echarts实例
                var Area = echarts.init(document.getElementById('area'));

                var posList = [
                    'left', 'right', 'top', 'bottom',
                    'inside',
                    'insideTop', 'insideLeft', 'insideRight', 'insideBottom',
                    'insideTopLeft', 'insideTopRight', 'insideBottomLeft', 'insideBottomRight'
                ];
                var app = {};
                app.configParameters = {
                    rotate: {
                        min: -90,
                        max: 90
                    },
                    align: {
                        options: {
                            left: 'left',
                            center: 'center',
                            right: 'right'
                        }
                    },
                    verticalAlign: {
                        options: {
                            top: 'top',
                            middle: 'middle',
                            bottom: 'bottom'
                        }
                    },
                    position: {
                        options: echarts.util.reduce(posList, function (map, pos) {
                            map[pos] = pos;
                            return map;
                        }, {})
                    },
                    distance: {
                        min: 0,
                        max: 100
                    }
                };

                app.config = {
                    rotate: 90,
                    align: 'left',
                    verticalAlign: 'middle',
                    position: 'insideBottom',
                    distance: 15,
                    onChange: function () {
                        var labelOption = {
                            normal: {
                                rotate: app.config.rotate,
                                align: app.config.align,
                                verticalAlign: app.config.verticalAlign,
                                position: app.config.position,
                                distance: app.config.distance
                            }
                        };
                        Area.setOption({
                            series: [{
                                label: labelOption
                            }, {
                                label: labelOption
                            }, {
                                label: labelOption
                            }, {
                                label: labelOption
                            }]
                        });
                    }
                };


                var labelOption = {
                    normal: {
                        show: false,
                        position: app.config.position,
                        distance: app.config.distance,
                        align: app.config.align,
                        verticalAlign: app.config.verticalAlign,
                        rotate: app.config.rotate,
                        formatter: '{c}  {name|{a}}',
                        fontSize: 16,
                        rich: {
                            name: {
                                textBorderColor: '#fff'
                            }
                        }
                    }
                };

                option = {
                    color: ['#003366', '#006699', '#4cabce', '#e5323e'],
                    tooltip: {
                        trigger: 'axis',
                        axisPointer: {
                            type: 'shadow'
                        }
                    },
                    legend: {
                        data: ['未派单', '已派单', '已处置', '满意度']
                    },
                    toolbox: {
                        show: true,
                        orient: 'vertical',
                        left: 'right',
                        top: 'center',
                        feature: {
                            mark: {show: true},
                            dataView: {show: true, readOnly: false},
                            magicType: {show: true, type: ['line', 'bar', 'stack', 'tiled']},
                            restore: {show: true},
                            saveAsImage: {show: true}
                        }
                    },
                    calculable: true,
                    xAxis: [
                        {
                            type: 'category',
                            axisTick: {show: false},
                            data: <?=$list?>
                        }
                    ],
                    yAxis: [
                        {
                            type: 'value'
                        }
                    ],
                    series: [
                        {
                            name: '未派单',
                            type: 'bar',
                            barGap: 0,
                            label: labelOption,
                            data: <?=$nodis?>
                        },
                        {
                            name: '已派单',
                            type: 'bar',
                            label: labelOption,
                            data: <?=$nosp?>
                        },
                        {
                            name: '已处置',
                            type: 'bar',
                            label: labelOption,
                            data: <?=$end?>
                        },
                        {
                            name: '满意度',
                            type: 'bar',
                            label: labelOption,
                            data:  <?=$man?>
                        }
                    ]
                };
                // 使用刚指定的配置项和数据显示图表。
                Area.setOption(option);
            </script>
	<!--footer-->
	<div class="footer" style="position: fixed;bottom: 0;">
	   <p>&copy; 2018 版权归舜网所有|  <a href="javascript:void(0)">济南文明城市管理大数据平台</a></p>
	</div>
    <!--//footer-->
	</div>

    <?php $this->endBody() ?>

    <?php $this->beginBlock('js') ?>
        $(document).ready(function(){
            
            $('#demo-pie-1').pieChart({
                barColor: '#2dde98',
                trackColor: '#eee',
                lineCap: 'round',
                lineWidth: 8,
                onStep: function (from, to, percent) {
                    $(this.element).find('.pie-value').text(Math.round(percent) + '%');
                }
            });

            $('#demo-pie-2').pieChart({
                barColor: '#8e43e7',
                trackColor: '#eee',
                lineCap: 'butt',
                lineWidth: 8,
                onStep: function (from, to, percent) {
                    $(this.element).find('.pie-value').text(Math.round(percent) + '%');
                }
            });

            $('#demo-pie-3').pieChart({
                barColor: '#ffc168',
                trackColor: '#eee',
                lineCap: 'square',
                lineWidth: 8,
                onStep: function (from, to, percent) {
                    $(this.element).find('.pie-value').text(Math.round(percent) + '%');
                }
            });

           
        });


	$('#page-wrapper').attr('style','min-height:'+(window.screen.height-100)+'px');
				var menuLeft = document.getElementById( 'cbp-spmenu-s1' ),
				showLeftPush = document.getElementById( 'showLeftPush' ),
				body = document.body;
        showLeftPush.onclick = function() {
            classie.toggle( this, 'active' );
            classie.toggle( body, 'cbp-spmenu-push-toright' );
            classie.toggle( menuLeft, 'cbp-spmenu-open' );
            disableOther( 'showLeftPush' );
        };
			

        function disableOther( button ) {
            if( button !== 'showLeftPush' ) {
                classie.toggle( showLeftPush, 'disabled' );
            }
        }
        $('.sidebar-menu').SidebarNav();
		function chat()
		{
			layer.open({
				type: 2,
				title:'聊天',
				closeBtn: 1, //不显示关闭按钮
				shadeClose: true,
				shade: false,
				area: ['950px', '600px'],
				maxmin: true, //开启最大化最小化按钮
				content: '<?=Url::toRoute(['/admin/chat/index'])?>', //iframe的url，no代表不显示滚动条
			
			});
        }
       
    <?php $this->endBlock() ?>
    <?php $this->registerJs($this->blocks['js'], \yii\web\View::POS_END); ?>
</body>
</html>
<?php $this->endPage() ?>